package com.zhihu_lvliangi_android.option.zhengwu;

import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

import com.zhihu_lvliangi_android.R;
import com.zhihu_lvliangi_android.option.general.GeneralWebviewActivity;
import com.zhihu_lvliangi_android.option.parent.ParentActivity;
import com.zhihu_lvliangi_android.util.RequestURL;
/*
 * 就业保障
 *
 * @sky
 */
public class AffairEmploymentActivity extends ParentActivity {

	private LinearLayout employment_zhinan,employment_msg,employment_query,employment_training,employment_people;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		int id = item.getItemId();
		if (id == android.R.id.home) {
			finish();
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
	

	@Override
	protected int getLayoutId() {
		return R.layout.fragment_affair_employment;
	}

	@Override
	protected void setupViews() {
		initActionBar();
		employment_zhinan = (LinearLayout) findViewById(R.id.employment_zhinan);
		employment_msg = (LinearLayout) findViewById(R.id.employment_msg);
		employment_query = (LinearLayout) findViewById(R.id.employment_query);
		employment_training = (LinearLayout) findViewById(R.id.employment_training);
		employment_people = (LinearLayout)findViewById(R.id.employment_people);


		employment_zhinan.setOnClickListener(onClickListener);
		employment_msg.setOnClickListener(onClickListener);
		employment_query.setOnClickListener(onClickListener);
		employment_training .setOnClickListener(onClickListener);
		employment_people.setOnClickListener(onClickListener);
	}
	private OnClickListener onClickListener = new OnClickListener() {

		@Override
		public void onClick(View v) {
			Bundle bundle = new Bundle();
			switch (v.getId()) {
			case R.id.employment_zhinan://就业指南
				bundle.putString(GeneralWebviewActivity.URL_KEY, RequestURL.employment_zhinan());
				startActivity(GeneralWebviewActivity.class,bundle);
				break;
			case R.id.employment_msg://招聘信息
				bundle.putString(GeneralWebviewActivity.URL_KEY, RequestURL.employment_msg());
				startActivity(GeneralWebviewActivity.class,bundle);
				break;
			case R.id.employment_query://岗位查询
				bundle.putString(GeneralWebviewActivity.URL_KEY, RequestURL.employment_query());
				startActivity(GeneralWebviewActivity.class,bundle);
				break;

			case R.id.employment_training://培训机构
				bundle.putString(GeneralWebviewActivity.URL_KEY, RequestURL.employment_training());
				startActivity(GeneralWebviewActivity.class,bundle);
				break;
			case R.id.employment_people://人才市场招聘会
				bundle.putString(GeneralWebviewActivity.URL_KEY, RequestURL.employment_people());
				startActivity(GeneralWebviewActivity.class,bundle);
				break;
			default:
				break;
			}

		}


	};
	private void initActionBar() {
		ActionBar actionBar = getSupportActionBar();
		actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.action_bar));
		actionBar.setDisplayHomeAsUpEnabled(true);
		actionBar.setIcon(new BitmapDrawable());//不设置图标icon
	}




	@Override
	protected void initialized() {

	}

	@Override
	protected void threadTask() {
	}





}
